package com.example.dagger2one.app;

import android.app.Application;
import android.content.Context;

/**
 * @作者: njb
 * @时间: 2019/7/22 11:07
 * @描述:
 */
public class App extends Application {
    //全局Context
    private static Context sContext;
    private static App instance;

    @Override
    public void onCreate() {
        super.onCreate();
        sContext = getApplicationContext();
    }

    //单例模式中获取唯一的MyApplication实例
    public static App getInstance() {
        return instance;
    }


    public static Context getContext() {
        return sContext;
    }
}
